#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 100
char CharEncoding(char ch);
void SentenceEncoding(char *soure,char *code);
int main()
{ 	 	     	 
    char source[N],code[N];
    printf("Input source sentence:");   
    gets(source);   //2
    SentenceEncoding(source,code);
    printf("Encoded sentence:");
    puts(code);   //1
    return 0;
} 	 	     	 
void SentenceEncoding(char *source,char *code)
{ 	 	     	 
    int i;
    for(i=0; source[i]!='\0';i++)    //1
    { 	 	     	 
        code[i] = CharEncoding(source[i]);  //1
    }
    code[i] = '\0';   //2
} 	 	     	 
char CharEncoding(char ch)
{ 	 	     	 
    char encode  = 0;
    if(ch>='A' && ch<='Z')     
    { 	 	     	 
        encode  = ('A'+'Z')- ch;     
    }
    else if(ch>='a' && ch<= 'z' )  
    { 	 	     	 
        encode  = 'a'+'z'-ch;    
    }
    else
    { 	 	     	 
        switch(ch)   
        { 	 	     	 
        case ' ': encode = '@';     
                    break;                  
        case '.': encode = '#';   
                    break;
        default: encode = '.';    
                    break;
        }
    }
    return encode;
}